package wc

import java.io.{InputStream, ObjectInputStream}
import java.net.{ServerSocket, Socket}

object Executor extends App {
  //服务器
  private val socket = new ServerSocket(9999)
  println("服务器 等待接受数据。。。")
  private val client: Socket = socket.accept()
  private val in: InputStream = client.getInputStream
  private val objectIn = new ObjectInputStream(in)
  private val task: Task = objectIn.readObject().asInstanceOf[Task]
  private val ints: List[Int] = task.compute()
  println(s"接收到数据：${ints}")
  in.close()
  client.close()
  socket.close()
}
